package com.ysz.learn.selflearn.controller;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ysz.learn.selflearn.annotation.Auth;
import com.ysz.learn.selflearn.annotation.MyLog;

import lombok.extern.slf4j.Slf4j;

/**
 * @description:
 * @author: yushizhong
 * @date: 2021-10-28 15:06
 * @version: 1.0
 **/
@RestController
@RequestMapping("/test")
@Slf4j
public class TestAnnotationController {

    @GetMapping("/login/{userName}")
    @MyLog(value = "clc", name = "tom")
    public HttpEntity test(@PathVariable String userName) {
        log.info("登录用户名称====>{}", userName);
        return new HttpEntity<>(HttpStatus.OK);

    }

    @Auth(desc = "登录校验")
    @GetMapping("/auth/{token}")
    public Object authLogin(@PathVariable String token) {

        return new HttpEntity<>(HttpStatus.OK);

    }
}
